// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 
// Source File Name:   KeyStoreInfo.java

package org.quickserver.util.xmlreader;

import java.io.Serializable;

public class KeyStoreInfo
    implements Serializable
{

    public KeyStoreInfo()
    {
        storeFile = "NONE";
        storePassword = null;
        keyPassword = null;
    }

    public void setStoreFile(String storeFile)
    {
        if(storeFile != null && storeFile.trim().length() != 0)
            this.storeFile = storeFile;
    }

    public String getStoreFile()
    {
        return storeFile;
    }

    public void setStorePassword(String storePassword)
    {
        if(storePassword != null)
            this.storePassword = storePassword;
    }

    public String getStorePassword()
    {
        return storePassword;
    }

    public void setKeyPassword(String keyPassword)
    {
        if(keyPassword != null)
            this.keyPassword = keyPassword;
    }

    public String getKeyPassword()
    {
        return keyPassword;
    }

    public String toXML(String pad)
    {
        if(pad == null)
            pad = "";
        StringBuilder sb = new StringBuilder();
        sb.append(pad).append("<key-store-info>\n");
        sb.append(pad).append("\t<store-file>").append(getStoreFile()).append("</store-file>\n");
        if(getStorePassword() != null)
            sb.append(pad).append("\t<store-password>").append(getStorePassword()).append("</store-password>\n");
        else
            sb.append(pad).append("\t</store-password>\n");
        if(getKeyPassword() != null)
            sb.append(pad).append("\t<key-password>").append(getKeyPassword()).append("</key-password>\n");
        else
            sb.append(pad).append("\t</key-password>\n");
        sb.append(pad).append("</key-store-info>\n");
        return sb.toString();
    }

    private String storeFile;
    private String storePassword;
    private String keyPassword;
}
